package org.jg.arkanoid.gameobjects;

import org.jg.arkanoid.engine.collider.CollisionEvent;


public class Carriage extends MovingObject{

	private int horizontalVelocity;
	
	@Override
	public void move() {
		position = position.addVector(velocity);
	}

	public int getHorizontalVelocity() {
		return horizontalVelocity;
	}

	public void setHorizontalVelocity(int horizontalVelocity) {
		this.horizontalVelocity = horizontalVelocity;
	}
	
	@Override
	public void callCollision(CollisionEvent event) {
		if(velocity != null)
		{
			position = position.addVector(velocity.multiply(-1));
		}
	}
}
